package cn.com.scitc.licenseplateback.model;

import javax.persistence.*;
import java.util.Objects;

@Entity
@Table(name = "BookingWarehousing", schema = "CubeLibrary", catalog = "")
public class BookingWarehousingEntity {
    private String name;
    private String idNumber;
    private String licensePlateNumber;
    private String bookingTime;
    private int memberGrade;
    private int waitingTime;
    private String bookingParking;
    private String tradeNo;
    private int status;
    private String address;

    @Basic
    @Column(name = "Name", nullable = false, length = 32)
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Basic
    @Column(name = "IDNumber", nullable = false, length = 18)
    public String getIdNumber() {
        return idNumber;
    }

    public void setIdNumber(String idNumber) {
        this.idNumber = idNumber;
    }

    @Basic
    @Column(name = "LicensePlateNumber", nullable = false, length = 32)
    public String getLicensePlateNumber() {
        return licensePlateNumber;
    }

    public void setLicensePlateNumber(String licensePlateNumber) {
        this.licensePlateNumber = licensePlateNumber;
    }

    @Basic
    @Column(name = "BookingTime", nullable = false)
    public String getBookingTime() {
        return bookingTime;
    }

    public void setBookingTime(String bookingTime) {
        this.bookingTime = bookingTime;
    }

    @Basic
    @Column(name = "MemberGrade", nullable = false)
    public int getMemberGrade() {
        return memberGrade;
    }

    public void setMemberGrade(int memberGrade) {
        this.memberGrade = memberGrade;
    }

    @Basic
    @Column(name = "WaitingTime", nullable = false)
    public int getWaitingTime() {
        return waitingTime;
    }

    public void setWaitingTime(int waitingTime) {
        this.waitingTime = waitingTime;
    }

    @Basic
    @Column(name = "BookingParking", nullable = false, length = 32)
    public String getBookingParking() {
        return bookingParking;
    }

    public void setBookingParking(String bookingParking) {
        this.bookingParking = bookingParking;
    }

    @Id
    @Column(name = "TradeNo", nullable = false, length = 80)
    public String getTradeNo() {
        return tradeNo;
    }

    public void setTradeNo(String tradeNo) {
        this.tradeNo = tradeNo;
    }

    @Basic
    @Column(name = "Status", nullable = false)
    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    @Basic
    @Column(name = "Address", nullable = true, length = 100)
    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        BookingWarehousingEntity that = (BookingWarehousingEntity) o;
        return memberGrade == that.memberGrade &&
                waitingTime == that.waitingTime &&
                status == that.status &&
                Objects.equals(name, that.name) &&
                Objects.equals(idNumber, that.idNumber) &&
                Objects.equals(licensePlateNumber, that.licensePlateNumber) &&
                Objects.equals(bookingTime, that.bookingTime) &&
                Objects.equals(bookingParking, that.bookingParking) &&
                Objects.equals(tradeNo, that.tradeNo) &&
                Objects.equals(address, that.address);
    }

    @Override
    public int hashCode() {
        return Objects.hash(name, idNumber, licensePlateNumber, bookingTime, memberGrade, waitingTime, bookingParking, tradeNo, status, address);
    }
}
